#ifndef STATELABEL_H
#define STATELABEL_H

#include <QLabel>
#include <QVector>
#include <QMenu>

struct StateData {
    QVariant value;
    QIcon icon;
    QString description;
    bool operator==(const QVariant& other) const { return value == other; }
};

class StateLabel : public QLabel {
    Q_OBJECT
public:
    explicit StateLabel(const QVector<StateData>& states,
                      const QVariant& initValue,
                      QWidget* parent = nullptr);

    QVariant currentValue() const { return m_currentValue; }
    void setCurrentValue(const QVariant& value);

signals:
    void valueChanged(const QVariant& newValue);

protected:
    void mousePressEvent(QMouseEvent* event) override;

private:
    void showStateMenu();
    void updateDisplay();

    QVector<StateData> m_states;
    QVariant m_currentValue;
    QMenu m_menu;
};
#endif


